package com.yonyou.cyxdms.basedata.service.util;

import com.xiaoleilu.hutool.util.ObjectUtil;
import com.yonyou.cyx.framework.util.bean.ApplicationContextHelper;
import com.yonyou.cyxdms.sysmanage.client.domains.dto.UserDictDto;
import com.yonyou.cyxdms.sysmanage.client.service.login.LoginService;


/**
 * 转换工具类
 *
 * @author lyz
 * @date 2020/11/24
 */
public class ConverterUtil {

    public static String getUserName(String userId) {
        LoginService bean = ApplicationContextHelper.getBeanByType(LoginService.class);
        UserDictDto user = bean.getUserById(Long.parseLong(userId));
        return ObjectUtil.defaultIfNull(user, new UserDictDto()).getUserName();
    }

}
